import {AlignItemsMap, DirectionTypeMap, JustifyContentMap} from "@/common/map";
import {ButtonGroupInterface} from "@/uni_modules/u-button-group/components/u-button-group/types";

export default defineComponent({
    // 定义默认属性
    props: {
        // 按钮数据
        data: {
            type: Array as PropType<ButtonGroupInterface[]>,
            default: (): ButtonGroupInterface[] =>
            {
                return [];
            }
        },
        // 布局方向
        buttonLayoutDirection: {
            type: String as PropType<DirectionType>,
            default: "horizontal",
            validator: (value: string): boolean =>
            {
                return DirectionTypeMap.includes(value);
            }
        },
        // X轴交叉对齐方式
        justifyContent: {
            type: String as PropType<JustifyContentType>,
            default: "space-around",
            validator: (value: string): boolean =>
            {
                return JustifyContentMap.includes(value);
            }
        },
        // Y轴交叉对齐方式
        alignItems: {
            type: String as PropType<AlignItemsType>,
            default: "center",
            validator: (value: string): boolean =>
            {
                return AlignItemsMap.includes(value);
            }
        },
        // 是否阻止事件传播
        stop: {
            type: Boolean,
            default: false
        },
        // 是否阻止事件默认行为
        prevent: {
            type: Boolean,
            default: false
        }
    }
});